package com.wm.youfangtong.newhouse.flutter.model

import android.content.Context
import com.google.gson.Gson

class FlutterRouteBean {

    private var content: MutableMap<String, String> = mutableMapOf()

    private var routeType = "/"


    /**
     * ///登录的token信息
     * String accessToken = '';
     *
     * ///登录的设备名称
     * String deviceName = '';
     *
     * ///登录的设备唯一id
     * String uniqueKey = '';
     *
     * ///app版本号
     * String appVersion = '';
     *
     * ///是否是驻场账号 0 不是  1：是
     * String reportManager = '0';
     *
     * ///是否是刘海屏 iOS刘海屏需要单独适配
     * String specialScreen = '0';
     *
     * ///当前选择的环境  0:测试  1:生产
     * String apiEnvironment = '0';
     */


    fun addProperty(key: String, value: String) {
        content[key] = value
    }


    fun createRoute(context: Context?, routeType: String): String {
        return Gson().toJson(builderRoute(context, routeType))
    }

    private fun builderRoute(context: Context?, routeType: String): FlutterRouteBean {
        val routeBean = FlutterRouteBean()
        routeBean.routeType = routeType
        routeBean.content["accessToken"] = "accessToken"
        routeBean.content["appVersion"] = "appVersion"
        routeBean.content["deviceName"] = "deviceName"
        routeBean.content["uniqueKey"] = "uniqueKey"
        routeBean.content["specialScreen"] = "specialScreen"
        routeBean.content["apiEnvironment"] = "apiEnvironment"
        routeBean.content["fangyouRelease"] = "fangyouRelease"
        return routeBean
    }

}